#include "sigma_function.h"
#include "math.h"

sigma_function::sigma_function(void)
{
}

sigma_function::~sigma_function(void)
{
}

double sigma_function::calc(double in, double p1){
  return tanh(in/p1);
//  return in;
}

double sigma_function::atanh(const double & v)
{
  double ret_val = (v + 1.) / (v - 1.);
  double is_minus = (ret_val < 0) ? -1. : 1.;
  ret_val = ret_val * is_minus;
  ret_val = log(ret_val);
  ret_val = ret_val * 0.5;
  return ret_val;
}


double sigma_function::calc_back(double in, double p1){
  return atanh(in) * p1;
//  return in;
}

